﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace SocketServerCSharp
{
    /// <summary>
    /// 通信数据
    /// </summary>
    [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public struct ComData
    {
        public int cmdID; //命令指令
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]//定义数组长度;4*16
        public int[] iData;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]//定义数组长度;8*16
        public double[] dData;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]//定义数组长度;
        public char[] cData;
        //public int quit; //中断信号
        public int result; //用于返回最终的检测结果

        public ComData(int _cmdID)
        {
            cmdID = _cmdID;
            iData = new int[16];
            dData = new double[16];
            cData = new char[256];
            //quit = 0;
            result = 0;
        }
    }
}
